home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / flstory.c < prev    next >
C/C++ Source or Header  |  2000-04-23  |  16KB  |  476 lines

  1. /***************************************************************************
  2.  
  3. The FairyLand Story
  4.  
  5. notes:
  6. - The 68705 doesn't pass the startup checksum test (causing "BAD HW"). This
  7.   is patched by changing one unused ROM byte to make it calculate the checksum
  8.   the main cpu expects. Possibilites:
  9.   1) The cpu<->mcu interface is wrong
  10.   2) the 68705 dump is bad
  11.   3) the 68705 program is for a different version of the main program
  12. - anyway, the 68705 isn't returning the expected data and the program hangs
  13.   when you start a game.
  14. - during the ROM checksum test the 68705 only reads 0x080-0x737 and 0x7f8-0x7ff.
  15.   During command processing, it reads 0x781 and 0x780 as if they were supposed
  16.   to change.
  17. - the wrong graphics are caused by the 68705.
  18. - sound communication not understood
  19. - sound section also has a MSM5232
  20.  
  21. ***************************************************************************/
  22.  
  23. #include "driver.h"
  24. #include "vidhrdw/generic.h"
  25. #include "cpu/z80/z80.h"
  26.  
  27. int flstory_vh_start(void);
  28. void flstory_vh_stop(void);
  29. void flstory_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  30. void flstory_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  31.  
  32. WRITE_HANDLER( flstory_palette_w );
  33. WRITE_HANDLER( flstory_gfxctrl_w );
  34.  
  35. READ_HANDLER( flstory_68705_portA_r );
  36. WRITE_HANDLER( flstory_68705_portA_w );
  37. READ_HANDLER( flstory_68705_portB_r );
  38. WRITE_HANDLER( flstory_68705_portB_w );
  39. READ_HANDLER( flstory_68705_portC_r );
  40. WRITE_HANDLER( flstory_68705_portC_w );
  41. WRITE_HANDLER( flstory_68705_ddrA_w );
  42. WRITE_HANDLER( flstory_68705_ddrB_w );
  43. WRITE_HANDLER( flstory_68705_ddrC_w );
  44. WRITE_HANDLER( flstory_mcu_w );
  45. READ_HANDLER( flstory_mcu_r );
  46. READ_HANDLER( flstory_mcu_status_r );
  47.  
  48.  
  49. int d400 = 0;
  50.  
  51. static WRITE_HANDLER( sound_command_w )
  52. {
  53.     d400 = data;
  54.     soundlatch_w(0,data);
  55.     cpu_cause_interrupt(1,Z80_NMI_INT);
  56. logerror("sound command %02x\n",data);
  57. }
  58.  
  59. static READ_HANDLER( flstory_d401_r )
  60. {
  61. /* writing $ef or $06 to $d400 makes bit 0 of d401 go hi */
  62.     /* it looks like writing $ef to $d400 is meant to eventually
  63.        cause bit 1 of $D401 to go low */
  64.  
  65.     /* it looks like writing $14 to $d400 is meant to eventually
  66.        cause bit 1 of $D401 to go high */
  67.  
  68.     /* 0213 needs d401 to have bit 1 set, or 'BAD SOUND' */
  69.  
  70.     if (d400 == 0xef)
  71.         return 0x01;
  72.     else
  73.         return 0x03;
  74. }
  75.  
  76.  
  77.  
  78. static struct MemoryReadAddress readmem[] =
  79. {
  80.     { 0x0000, 0xbfff, MRA_ROM },
  81.     { 0xc000, 0xc7ff, MRA_RAM },
  82.     { 0xd000, 0xd000, flstory_mcu_r },
  83. //    { 0xd400, 0xd400, MRA_RAM },
  84.     { 0xd401, 0xd401, flstory_d401_r },
  85.     { 0xd800, 0xd800, input_port_0_r },
  86.     { 0xd801, 0xd801, input_port_1_r },
  87.     { 0xd802, 0xd802, input_port_2_r },
  88.     { 0xd803, 0xd803, input_port_3_r },
  89.     { 0xd804, 0xd804, input_port_4_r },
  90.     { 0xd805, 0xd805, flstory_mcu_status_r },
  91.     { 0xd806, 0xd806, input_port_5_r },
  92.     { 0xe000, 0xe7ff, MRA_RAM },
  93.     { -1 }  /* end of table */
  94. };
  95.  
  96. static struct MemoryWriteAddress writemem[] =
  97. {
  98.     { 0x0000, 0xbfff, MWA_ROM },
  99.     { 0xc000, 0xc7ff, videoram_w, &videoram, &videoram_size },
  100.     { 0xd000, 0xd000, flstory_mcu_w },
  101.     { 0xd001, 0xd001, MWA_RAM },    /* ??? */
  102.     { 0xd002, 0xd002, MWA_RAM },    /* ??? */
  103.     { 0xd400, 0xd400, sound_command_w },
  104. //    { 0xda00, 0xda00, MWA_RAM },
  105.     { 0xdc00, 0xdc7f, MWA_RAM, &spriteram, &spriteram_size },
  106.     { 0xdd00, 0xdeff, flstory_palette_w },
  107.     { 0xdf03, 0xdf03, flstory_gfxctrl_w },
  108.     { 0xe000, 0xe7ff, MWA_RAM },    /* work RAM */
  109.     { -1 }  /* end of table */
  110. };
  111.  
  112. static struct MemoryReadAddress sound_readmem[] =
  113. {
  114.     { 0x0000, 0xbfff, MRA_ROM },
  115.     { 0xc000, 0xc7ff, MRA_RAM },
  116.     { 0xd800, 0xd800, soundlatch_r },
  117.     { 0xe000, 0xefff, MRA_ROM },    /* space for diagnostics ROM */
  118.     { -1 }  /* end of table */
  119. };
  120.  
  121. static struct MemoryWriteAddress sound_writemem[] =
  122. {
  123.     { 0x0000, 0xbfff, MWA_ROM },
  124.     { 0xc000, 0xc7ff, MWA_RAM },
  125.     { 0xc800, 0xc800, AY8910_control_port_0_w },
  126.     { 0xc801, 0xc801, AY8910_write_port_0_w },
  127.     { 0xca00, 0xca0d, MWA_RAM },    /* MSM5232 registers */
  128.     { 0xcc00, 0xcc00, MWA_RAM },    /* MSM5232 port 0 */
  129.     { 0xce00, 0xce00, MWA_RAM },    /* MSM5232 port 1 */
  130.     { 0xda00, 0xda00, MWA_RAM },    /* ??? */
  131.     { 0xdc00, 0xdc00, MWA_RAM },    /* ??? */
  132.     { 0xe000, 0xefff, MWA_ROM },
  133.     { -1 }  /* end of table */
  134. };
  135.  
  136. static struct MemoryReadAddress m68705_readmem[] =
  137. {
  138.     { 0x0000, 0x0000, flstory_68705_portA_r },
  139.     { 0x0001, 0x0001, flstory_68705_portB_r },
  140.     { 0x0002, 0x0002, flstory_68705_portC_r },
  141.     { 0x0010, 0x007f, MRA_RAM },
  142.     { 0x0080, 0x07ff, MRA_ROM },
  143.     { -1 }    /* end of table */
  144. };
  145.  
  146. static struct MemoryWriteAddress m68705_writemem[] =
  147. {
  148.     { 0x0000, 0x0000, flstory_68705_portA_w },
  149.     { 0x0001, 0x0001, flstory_68705_portB_w },
  150.     { 0x0002, 0x0002, flstory_68705_portC_w },
  151.     { 0x0004, 0x0004, flstory_68705_ddrA_w },
  152.     { 0x0005, 0x0005, flstory_68705_ddrB_w },
  153.     { 0x0006, 0x0006, flstory_68705_ddrC_w },
  154.     { 0x0010, 0x007f, MWA_RAM },
  155.     { 0x0080, 0x07ff, MWA_ROM },
  156.     { -1 }    /* end of table */
  157. };
  158.  
  159.  
  160.  
  161. INPUT_PORTS_START( flstory )
  162.     PORT_START      /* D800: DSW0 */
  163.     PORT_DIPNAME(0x03, 0x00, DEF_STR( Bonus_Life ) )
  164.     PORT_DIPSETTING(   0x00, "30000 100000" )
  165.     PORT_DIPSETTING(   0x01, "30000 150000" )
  166.     PORT_DIPSETTING(   0x02, "50000 150000" )
  167.     PORT_DIPSETTING(   0x03, "70000 150000" )
  168.     PORT_DIPNAME(0x04, 0x04, DEF_STR( Free_Play ) )
  169.     PORT_DIPSETTING(   0x04, DEF_STR( Off ) )
  170.     PORT_DIPSETTING(   0x00, DEF_STR( On ) )
  171.     PORT_DIPNAME(0x18, 0x08, "??? (046c)" )
  172.     PORT_DIPSETTING(   0x00, "ENDLESS?" )
  173.     PORT_DIPSETTING(   0x08, "3" )
  174.     PORT_DIPSETTING(   0x10, "4" )
  175.     PORT_DIPSETTING(   0x18, "5" )
  176.     PORT_DIPNAME(0x20, 0x20, "??? (0683)" )
  177.     PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
  178.     PORT_DIPSETTING(   0x00, DEF_STR( On ) )
  179.     PORT_DIPNAME(0x40, 0x40, DEF_STR( Unknown ) )    /* flip screen? */
  180.     PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
  181.     PORT_DIPSETTING(   0x00, DEF_STR( On ) )
  182.     PORT_DIPNAME(0x80, 0x80, DEF_STR( Unknown ) )    /* cabinet? */
  183.     PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
  184.     PORT_DIPSETTING(   0x00, DEF_STR( On ) )
  185.  
  186.     PORT_START      /* D801: DSW1 */
  187.     PORT_DIPNAME(0x0f, 0x00, DEF_STR( Coin_A ) )
  188.     PORT_DIPSETTING(   0x0f, DEF_STR( 9C_1C ) )
  189.     PORT_DIPSETTING(   0x0e, DEF_STR( 8C_1C ) )
  190.     PORT_DIPSETTING(   0x0d, DEF_STR( 7C_1C ) )
  191.     PORT_DIPSETTING(   0x0c, DEF_STR( 6C_1C ) )
  192.     PORT_DIPSETTING(   0x0b, DEF_STR( 5C_1C ) )
  193.     PORT_DIPSETTING(   0x0a, DEF_STR( 4C_1C ) )
  194.     PORT_DIPSETTING(   0x09, DEF_STR( 3C_1C ) )
  195.     PORT_DIPSETTING(   0x08, DEF_STR( 2C_1C ) )
  196.     PORT_DIPSETTING(   0x00, DEF_STR( 1C_1C ) )
  197.     PORT_DIPSETTING(   0x01, DEF_STR( 1C_2C ) )
  198.     PORT_DIPSETTING(   0x02, DEF_STR( 1C_3C ) )
  199.     PORT_DIPSETTING(   0x03, DEF_STR( 1C_4C ) )
  200.     PORT_DIPSETTING(   0x04, DEF_STR( 1C_5C ) )
  201.     PORT_DIPSETTING(   0x05, DEF_STR( 1C_6C ) )
  202.     PORT_DIPSETTING(   0x06, DEF_STR( 1C_7C ) )
  203.     PORT_DIPSETTING(   0x07, DEF_STR( 1C_8C ) )
  204.     PORT_DIPNAME(0xf0, 0x00, DEF_STR( Coin_B ) )
  205.     PORT_DIPSETTING(   0xf0, DEF_STR( 9C_1C ) )
  206.     PORT_DIPSETTING(   0xe0, DEF_STR( 8C_1C ) )
  207.     PORT_DIPSETTING(   0xd0, DEF_STR( 7C_1C ) )
  208.     PORT_DIPSETTING(   0xc0, DEF_STR( 6C_1C ) )
  209.     PORT_DIPSETTING(   0xb0, DEF_STR( 5C_1C ) )
  210.     PORT_DIPSETTING(   0xa0, DEF_STR( 4C_1C ) )
  211.     PORT_DIPSETTING(   0x90, DEF_STR( 3C_1C ) )
  212.     PORT_DIPSETTING(   0x80, DEF_STR( 2C_1C ) )
  213.     PORT_DIPSETTING(   0x00, DEF_STR( 1C_1C ) )
  214.     PORT_DIPSETTING(   0x10, DEF_STR( 1C_2C ) )
  215.     PORT_DIPSETTING(   0x20, DEF_STR( 1C_3C ) )
  216.     PORT_DIPSETTING(   0x30, DEF_STR( 1C_4C ) )
  217.     PORT_DIPSETTING(   0x40, DEF_STR( 1C_5C ) )
  218.     PORT_DIPSETTING(   0x50, DEF_STR( 1C_6C ) )
  219.     PORT_DIPSETTING(   0x60, DEF_STR( 1C_7C ) )
  220.     PORT_DIPSETTING(   0x70, DEF_STR( 1C_8C ) )
  221.  
  222.     PORT_START      /* D802: COINS */
  223.     PORT_DIPNAME(0x01, 0x01, DEF_STR( Unknown ) )
  224.     PORT_DIPSETTING(   0x01, DEF_STR( Off ) )
  225.     PORT_DIPSETTING(   0x00, DEF_STR( On ) )
  226.     PORT_DIPNAME(0x02, 0x02, DEF_STR( Unknown ) )
  227.     PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
  228.     PORT_DIPSETTING(   0x00, DEF_STR( On ) )
  229.     PORT_DIPNAME(0x04, 0x04, DEF_STR( Unknown ) )
  230.     PORT_DIPSETTING(   0x04, DEF_STR( Off ) )
  231.     PORT_DIPSETTING(   0x00, DEF_STR( On ) )
  232.     PORT_DIPNAME(0x08, 0x08, DEF_STR( Unknown ) )
  233.     PORT_DIPSETTING(   0x08, DEF_STR( Off ) )
  234.     PORT_DIPSETTING(   0x00, DEF_STR( On ) )
  235.     PORT_DIPNAME(0x10, 0x10, "Attract Animation" )
  236.     PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
  237.     PORT_DIPSETTING(   0x10, DEF_STR( On ) )
  238.     PORT_DIPNAME(0x20, 0x20, DEF_STR( Unknown ) )
  239.     PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
  240.     PORT_DIPSETTING(   0x00, DEF_STR( On ) )
  241.     PORT_BITX(    0x40, 0x40, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability?", IP_KEY_NONE, IP_JOY_NONE )
  242.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  243.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  244.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) )
  245.     PORT_DIPSETTING(    0x80, "A and B" )
  246.     PORT_DIPSETTING(    0x00, "A only" )
  247.  
  248.     PORT_START      /* D803: START BUTTONS */
  249.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  250.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  251.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
  252.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT )
  253.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
  254.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
  255.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* "BAD IO" if low */
  256.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* "BAD IO" if low */
  257.  
  258.     PORT_START      /* D804: P1? */
  259.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
  260.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  261.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  262.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  263.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  264.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  265.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  266.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  267.  
  268.     PORT_START      /* D806: P2? */
  269.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
  270.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  271.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  272.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  273.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  274.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  275.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  276.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  277. INPUT_PORTS_END
  278.  
  279.  
  280.  
  281. static struct GfxLayout charlayout =
  282. {
  283.     8,8,
  284.     RGN_FRAC(1,2),
  285.     4,
  286.     { RGN_FRAC(1,2)+0, RGN_FRAC(1,2)+4, 0, 4 },
  287.     { 3, 2, 1, 0, 8+3, 8+2, 8+1, 8+0 },
  288.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
  289.     16*8
  290. };
  291.  
  292. static struct GfxLayout spritelayout =
  293. {
  294.     16,16,
  295.     RGN_FRAC(1,2),
  296.     4,
  297.     { RGN_FRAC(1,2)+0, RGN_FRAC(1,2)+4, 0, 4 },
  298.     { 3, 2, 1, 0, 8+3, 8+2, 8+1, 8+0,
  299.             16*8+3, 16*8+2, 16*8+1, 16*8+0, 16*8+8+3, 16*8+8+2, 16*8+8+1, 16*8+8+0 },
  300.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
  301.             16*16, 17*16, 18*16, 19*16, 20*16, 21*16, 22*16, 23*16 },
  302.     64*8
  303. };
  304.  
  305. static struct GfxDecodeInfo gfxdecodeinfo[] =
  306. {
  307.     { REGION_GFX1, 0, &charlayout,     0, 16 },
  308.     { REGION_GFX1, 0, &spritelayout, 256, 16 },
  309.     { -1 }    /* end of array */
  310. };
  311.  
  312.  
  313.  
  314. static struct AY8910interface ay8910_interface =
  315. {
  316.     1,    /* 1 chip */
  317.     8000000/4,    /* ??? */
  318.     { 50 },
  319.     { 0 },
  320.     { 0 },
  321.     { 0 },
  322.     { 0 }
  323. };
  324.  
  325.  
  326.  
  327. static struct MachineDriver machine_driver_flstory =
  328. {
  329.     /* basic machine hardware */
  330.     {
  331.         {
  332.             CPU_Z80,
  333.             10733000/2,        /* ??? */
  334.             readmem,writemem,0,0,
  335.             interrupt,1
  336.         },
  337.         {
  338.             CPU_Z80 | CPU_AUDIO_CPU,
  339.             8000000/2,        /* 4 MHz */
  340.             sound_readmem,sound_writemem,0,0,
  341.             interrupt,1    /* IRQ generated by ??? */
  342.                         /* NMI generated by the main CPU */
  343.         },
  344.         {
  345.             CPU_M68705,
  346.             4000000/2,    /* ??? */
  347.             m68705_readmem,m68705_writemem,0,0,
  348.             ignore_interrupt,0
  349.         }
  350.     },
  351.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  352.     100,    /* 100 CPU slices per frame - an high value to ensure proper */
  353.             /* synchronization of the CPUs */
  354.     0,
  355.  
  356.     /* video hardware */
  357.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  358.     gfxdecodeinfo,
  359.     512, 512,
  360.     flstory_vh_convert_color_prom,
  361.  
  362.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  363.     0,
  364.     flstory_vh_start,
  365.     flstory_vh_stop,
  366.     flstory_vh_screenrefresh,
  367.  
  368.     /* sound hardware */
  369.     0,0,0,0,
  370.     {
  371.         {
  372.             SOUND_AY8910,
  373.             &ay8910_interface
  374.         }
  375.     }
  376. };
  377.  
  378.  
  379.  
  380. /***************************************************************************
  381.  
  382.   Game driver(s)
  383.  
  384. ***************************************************************************/
  385.  
  386. ROM_START( flstory )
  387.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for the first CPU */
  388.     ROM_LOAD( "cpu-a45.15",   0x0000, 0x4000, 0xf03fc969 )
  389.     ROM_LOAD( "cpu-a45.16",   0x4000, 0x4000, 0x311aa82e )
  390.     ROM_LOAD( "cpu-a45.17",   0x8000, 0x4000, 0xa2b5d17d )
  391.  
  392.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  393.     ROM_LOAD( "snd.22",       0x0000, 0x2000, 0xd58b201d )
  394.     ROM_LOAD( "snd.23",       0x2000, 0x2000, 0x25e7fd9d )
  395.  
  396.     ROM_REGION( 0x0800, REGION_CPU3 )    /* 2k for the microcontroller */
  397.     ROM_LOAD( "p5sa54-.09",   0x0000, 0x0800, 0x0e8b8846 )
  398.  
  399.     ROM_REGION( 0x20000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  400.     ROM_LOAD( "vid-a45.18",   0x00000, 0x4000, 0x6f08f69e )
  401.     ROM_LOAD( "vid-a45.20",   0x04000, 0x4000, 0x1b0edf34 )
  402.     ROM_LOAD( "vid-a45.08",   0x08000, 0x4000, 0xd0b028ca )
  403.     ROM_LOAD( "vid-a45.06",   0x0c000, 0x4000, 0xdc856a75 )
  404.     ROM_LOAD( "vid-a45.19",   0x10000, 0x4000, 0x2b572dc9 )
  405.     ROM_LOAD( "vid-a45.21",   0x14000, 0x4000, 0xfc382bd1 )
  406.     ROM_LOAD( "vid-a45.09",   0x18000, 0x4000, 0x8336be58 )
  407.     ROM_LOAD( "vid-a45.07",   0x1c000, 0x4000, 0xaa4b0762 )
  408. ROM_END
  409.  
  410. ROM_START( flstoryj )
  411.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for the first CPU */
  412.     ROM_LOAD( "cpu-a45.15",   0x0000, 0x4000, 0xf03fc969 )
  413.     ROM_LOAD( "cpu-a45.16",   0x4000, 0x4000, 0x311aa82e )
  414.     ROM_LOAD( "cpu-a45.17",   0x8000, 0x4000, 0xa2b5d17d )
  415.  
  416.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  417.     ROM_LOAD( "a45_12.8",     0x0000, 0x2000, 0xd6f593fb )
  418.     ROM_LOAD( "a45_13.9",     0x2000, 0x2000, 0x451f92f9 )
  419.  
  420.     ROM_REGION( 0x0800, REGION_CPU3 )    /* 2k for the microcontroller */
  421.     ROM_LOAD( "p5sa54-.09",   0x0000, 0x0800, 0x0e8b8846 )    /* from the english version - might be wrong */
  422.  
  423.     ROM_REGION( 0x20000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  424.     ROM_LOAD( "vid-a45.18",   0x00000, 0x4000, 0x6f08f69e )
  425.     ROM_LOAD( "vid-a45.20",   0x04000, 0x4000, 0x1b0edf34 )
  426.     ROM_LOAD( "vid-a45.08",   0x08000, 0x4000, 0xd0b028ca )
  427.     ROM_LOAD( "vid-a45.06",   0x0c000, 0x4000, 0xdc856a75 )
  428.     ROM_LOAD( "vid-a45.19",   0x10000, 0x4000, 0x2b572dc9 )
  429.     ROM_LOAD( "vid-a45.21",   0x14000, 0x4000, 0xfc382bd1 )
  430.     ROM_LOAD( "vid-a45.09",   0x18000, 0x4000, 0x8336be58 )
  431.     ROM_LOAD( "vid-a45.07",   0x1c000, 0x4000, 0xaa4b0762 )
  432. ROM_END
  433.  
  434. ROM_START( onna34ro )
  435.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for the first CPU */
  436.     ROM_LOAD( "a52-01-1.40c", 0x0000, 0x4000, 0xffddcb02 )
  437.     ROM_LOAD( "a52-02-1.41c", 0x4000, 0x4000, 0xda97150d )
  438.     ROM_LOAD( "a52-03-1.42c", 0x8000, 0x4000, 0xb9749a53 )
  439.  
  440.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  441.     ROM_LOAD( "a52-12.08s",   0x0000, 0x2000, 0x28f48096 )
  442.     ROM_LOAD( "a52-13.09s",   0x2000, 0x2000, 0x4d3b16f3 )
  443.     ROM_LOAD( "a52-14.10s",   0x4000, 0x2000, 0x90a6f4e8 )
  444.     ROM_LOAD( "a52-15.37s",   0x6000, 0x2000, 0x5afc21d0 )
  445.     ROM_LOAD( "a52-16.38s",   0x8000, 0x2000, 0xccf42aee )
  446.  
  447.     ROM_REGION( 0x0800, REGION_CPU3 )    /* 2k for the microcontroller */
  448.     ROM_LOAD( "a52-17.54c",   0x0000, 0x0800, 0x00000000 )
  449.  
  450.     ROM_REGION( 0x20000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  451.     ROM_LOAD( "a52-04.11v",   0x00000, 0x4000, 0x5b126294 )
  452.     ROM_LOAD( "a52-06.10v",   0x04000, 0x4000, 0x78114721 )
  453.     ROM_LOAD( "a52-08.09v",   0x08000, 0x4000, 0x4a293745 )
  454.     ROM_LOAD( "a52-10.08v",   0x0c000, 0x4000, 0x8be7b4db )
  455.     ROM_LOAD( "a52-05.35v",   0x10000, 0x4000, 0xa1a99588 )
  456.     ROM_LOAD( "a52-07.34v",   0x14000, 0x4000, 0x0bf420f2 )
  457.     ROM_LOAD( "a52-09.33v",   0x18000, 0x4000, 0x39c543b5 )
  458.     ROM_LOAD( "a52-11.32v",   0x1c000, 0x4000, 0xd1dda6b3 )
  459. ROM_END
  460.  
  461.  
  462.  
  463. static void init_flstory(void)
  464. {
  465.     /* patch one 68705 unused ROM location to make it pass the startup */
  466.     /* checksum test. It is supposed to return 0xf9, without this patch */
  467.     /* it would return 0x89 */
  468.     memory_region(REGION_CPU3)[0x2c0] = 0x6f;
  469. }
  470.  
  471.  
  472.  
  473. GAMEX( 1985, flstory,  0,       flstory, flstory, flstory, ROT180, "Taito", "The FairyLand Story", GAME_NOT_WORKING )
  474. GAMEX( 1985, flstoryj, flstory, flstory, flstory, flstory, ROT180, "Taito", "The FairyLand Story (Japan)", GAME_NOT_WORKING )
  475. GAMEX( 1985, onna34ro, 0,       flstory, flstory, flstory, ROT180, "Taito", "Onna Sansirou (Japan)", GAME_NOT_WORKING )
  476.